package com.woniu.his.service.impl;

import com.woniu.his.dao.SectionInfoMapper;
import com.woniu.his.entity.SectionInfo;
import com.woniu.his.entity.SectionType;
import com.woniu.his.dao.SectionTypeMapper;
import com.woniu.his.service.ISectionTypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author TATO
 * @since 2019-11-25
 */
@Service
public class SectionTypeServiceImpl extends ServiceImpl<SectionTypeMapper, SectionType> implements ISectionTypeService {

    @Autowired
    private SectionInfoMapper sectionInfoMapper;

    /**
     *@描述
     *@参数  根据一级科室的名字查找二级科室
     *@返回值  
     *@创建人  li
     *@创建时间  2019/11/25 0025
     *@修改人和其它信息
     */
    @Override
    public List<SectionInfo> findSectionInfo(String sectionName) {

//        内科的id为1
        if ("内科".equals(sectionName)){
            return sectionInfoMapper.findSectionInfoBySectionTypeId(1);
        }
//        外科的id为2
        if ("外科".equals(sectionName)){
            return sectionInfoMapper.findSectionInfoBySectionTypeId(2);
        }

        return null;
    }
}
